import '../FileRes.dart';

// busType "1-1"是录音和定位  "1-2"电子签名  '1-3'图片视频
const String BUS_TYPE_RECORD = "1-1";
const String BUS_TYPE_SIGNATURE = "1-2";
const String BUS_TYPE_PHOTO_VIDEO = "1-3";

class SaveTaskFile {
  SaveTaskFile({
    this.busType,
    this.writeId,
    this.address,
    this.latitude,
    this.longitude,
    this.fileShowList,
  });

  SaveTaskFile.fromJson(dynamic json) {
    busType = json['busType'];
    writeId = json['writeId'];
    address = json['address'];
    latitude = json['latitude'];
    longitude = json['longitude'];
    if (json['fileShowList'] != null) {
      fileShowList = [];
      json['fileShowList'].forEach((v) {
        fileShowList?.add(FileRes.fromJson(v));
      });
    }
  }

  String? busType;
  String? writeId;
  String? address;
  String? latitude;
  String? longitude;
  List<FileRes>? fileShowList;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['busType'] = busType;
    map['writeId'] = writeId;
    map['address'] = address;
    map['latitude'] = latitude;
    map['longitude'] = longitude;
    if (fileShowList != null) {
      map['fileShowList'] = fileShowList?.map((v) => v.toJson()).toList();
    }
    return map;
  }
}
